<template>
  <div>
    <header>
      <div class="left">
        <h1>陈优秀， 下午好</h1>
        <p>今天为你推荐4款商品哦~~</p>
      </div>
      <div class="right">
        <span>
          <van-icon name="search" />
        </span>
      </div>
    </header>
    <!-- <section id="banner">
      <div class="swiper-container1">
        <div class="swiper-wrapper">
          <div class="swiper-slide">Slide 1</div>
          <div class="swiper-slide">Slide 2</div>
          <div class="swiper-slide">Slide 3</div>
        </div>
      </div>
    </section> -->
    <nav>
      <p>
        新品 top.10
        <span>查看更多 ></span>
      </p>
      <div class="swiper-container">
        <div class="swiper-wrapper">
          <div class="swiper-slide">
            <!-- <img src="../../../public/cznimg/1.png" alt /> -->
            <h3>简易家具镜</h3>
            <h4>￥89.50</h4>
          </div>
          <div class="swiper-slide">
            <!-- <img src=../../../public/cznimg/1.png"/> -->
            <h3>简易家具镜</h3>
            <h4>￥89.50</h4>
          </div>
          <div class="swiper-slide">
            <!-- <img src=../../../public/cznimg/1.png" alt /> -->
            <h3>简易家具镜</h3>
            <h4>￥89.50</h4>
          </div>
          <div class="swiper-slide">
            <!-- <img src=../../../public/cznimg/1.png" /> -->
            <h3>简易家具镜</h3>
            <h4>￥89.50</h4>
          </div>
          <div class="swiper-slide">
            <!-- <img src=../../../public/cznimg/1.png" alt /> -->
            <h3>简易家具镜</h3>
            <h4>￥89.50</h4>
          </div>
        </div>
      </div>
    </nav>
    <main>
      <h1>热销</h1>
      <ul>
        <li>
          <img src="../../../public/cznimg/2.png" alt />
          <h3>简易家具镜</h3>
          <h4>￥89.50</h4>
        </li>
        <li>
          <img src="../../../public/cznimg/2.png" alt />
          <h3>简易家具镜</h3>
          <h4>￥89.50</h4>
        </li>
        <li>
          <img src="../../../public/cznimg/2.png" alt />
          <h3>简易家具镜</h3>
          <h4>￥89.50</h4>
        </li>
        <li>
          <img src="../../../public/cznimg/2.png" alt />
          <h3>简易家具镜</h3>
          <h4>￥89.50</h4>
        </li>
      </ul>
    </main>
  </div>
</template>

<script>
import Swiper from "swiper";
import "swiper/css/swiper.css";
export default {
  mounted() {
    new Swiper(".swiper-container", {
      // loop: true, // 循环模式选项
      // 如果需要分页器
      pagination: {
        el: ".swiper-pagination"
      },
      slidesPerView: 2,
      // 如果需要前进后退按钮
      navigation: {
        nextEl: ".swiper-button-next",
        prevEl: ".swiper-button-prev"
      },
      // 如果需要滚动条
      scrollbar: {
        el: ".swiper-scrollbar"
      }
    });
    new Swiper(".swiper-container1", {
      effect: "coverflow",
      slidesPerView: 3,
      centeredSlides: true,
      coverflowEffect: {
        rotate: 30,
        stretch: 10,
        depth: 60,
        modifier: 2,
        slideShadows: true
      }
    });
  }
};
</script>
<style lang="scss" scoped>
* {
  padding: 0;
  margin: 0;
}
html {
  font-size: 26.666666vw;
}
footer {
  display: flex;
}
nav {
  padding-left: 1rem;
  p {
    font: 600 20px/20px "";
    span {
      float: right;
      font: 15px/20px "";
      color: rgba(0, 0, 0, 0.5);
      padding-right: 1rem;
    }
  }
  .swiper-slide {
    margin: 0 auto;
    display: table-cell;
    text-align: center;
    img {
      width: 9rem;
    }
    h3 {
      text-align: center;
    }
    h4 {
      text-align: center;
    }
  }
}
main {
  padding: 0 1rem;
  h1 {
    font: 600 20px/80px "";
  }
  ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    // padding: 0 1rem;

    li {
      img {
        width: 10.4rem;
      }
      h3 {
        text-align: center;
        font: 600 15px/24px "";
      }
      h4 {
        text-align: center;
        font: 600 14px/40px "";
      }
    }
  }
}
</style>
